<template>
  <div class="search_list">
    <ol v-for="(item,index) in data" :key="index" @click="$emit('click')">
      <img :src="item.image_path" v-if="item.image_path" />
      <i v-else class="fa fa-search"></i>
      <div class="shopItem">
        <span class="title">{{item.name || item}}</span>
        <span class="rating" v-if="item.rating">评分{{item.rating}}</span>
      </div>
    </ol>
  </div>
</template>

<script>
export default {
  name: "searchIndex",
  props: {
    data: Array,
  },
  data() {
    return {};
  },
};
</script>

<style scoped>
.search_list {
  font-size: 12px;
  text-align: left;
  border: 1px solid rgb(205, 19, 19);
}
.search_list img {
  width: 30px;
}
.search_list .title {
  color: red;
  padding: 20px;
  border-bottom: 1px solid aqua;
}
</style>